#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

void dump(int fd)
{
	sleep(1);
	dup2(fd,);
	printf("the child : %d\n",fd);
}

int main()
{
	pid_t pid;
	int fd;

	fd = open("log.txt", O_RDONLY);
	pid = fork();
	if(pid == 0){
		dump(fd);
	}
	printf("the father : %d\n",fd);
	return 0;
}
